MapboxRouteShieldApi

class MapboxRouteShieldApi

A class that can be used to request route shields using either BannerComponents.imageBaseUrl or BannerComponents.mapboxShield. The class exposes API(s) that one can invoke to either always use mapbox legacy shields BannerComponents.imageBaseUrl or use mapbox designed shields BannerComponents.mapboxShield. In cases where API is unable to download mapbox designed shields for any reason, the API falls back to download legacy shields if available. Returns error otherwise.

MapboxRouteShieldApi returns route shield with text in the form of a SVG wrapped in a ByteArray. Since this SVG would later have to be converted to vector drawable at runtime for rendering purposes, it is important to note that the API supports most of the SVG features from Tiny SVG 1.2.

Constructors

MapboxRouteShieldApi
Link copied to clipboard
fun MapboxRouteShieldApi()

Functions

cancel
Link copied to clipboard
fun cancel()
Invoke the function to cancel any job invoked through other APIs
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
getRouteShields
Link copied to clipboard
fun getRouteShields(road: Road, callback: RouteShieldCallback)
Given a Road object, the function requests mapbox legacy road shields (if available) using Road.shieldUrl for the current road.
fun getRouteShields(bannerComponents: List<BannerComponents>?, callback: RouteShieldCallback)
Given a list of BannerComponents the function requests mapbox legacy road shields (if available) using BannerComponents.imageBaseUrl.
fun getRouteShields(road: Road, userId: String?, styleId: String?, accessToken: String?, callback: RouteShieldCallback)
Given a Road object, the function requests mapbox designed road shields (if available) using Road.
fun getRouteShields(bannerComponents: List<BannerComponents>?, userId: String?, styleId: String?, accessToken: String?, callback: RouteShieldCallback)
Given a list of BannerComponents the function requests mapbox designed road shields (if available) using BannerComponents.mapboxShield.
hashCode
Link copied to clipboard
open fun hashCode(): Int
toString
Link copied to clipboard
open fun toString(): String